package com.learn.bean;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

@Component
public class Fox implements BeanNameAware , BeanFactoryAware, InitializingBean {

	private String beanName;

	@Override
	public void setBeanName(String name) {

		System.out.println("==========setBeanName================");
	    this.beanName = name;
	}

	@Override
	public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
		System.out.println("==========setBeanFactory=============");
	}

	/**
	 * 初始化
	 * @throws Exception
	 */
	@Override
	public void afterPropertiesSet() throws Exception {
		System.out.println("==========afterPropertiesSet=========");
	}
}
